<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="https://api.cloudcpc.com/static/index/js/jquery-1.7.2.js"></script>
</head>
<body>
<div>
    <ul id="test">
      <li></li>
    </ul>
</div>
<script>
  var  list1=[
    {
      company_id: "5",
      numrow: "1",
      isOn:'0',
      real_name: "林庆",
      role_id: "23",
      section_id: "44",
      user_id: "23",
      user_name: "linqinghu1",
      user_position: "111",
    },
    {
      company_id: "5",
      numrow: "1",
      isOn:'0',
      real_name: "aaaawfa",
      role_id: "23",
      section_id: "44",
      user_id: "23",
      user_name: "linqinghu1",
      user_position: "111",
    },
    {
      company_id: "5",
      numrow: "1",
      isOn:'0',
      real_name: "我都问",
      role_id: "23",
      section_id: "44",
      user_id: "23",
      user_name: "linqinghu1",
      user_position: "111",
    }
  ];
  var data =[];
  var timer =setTimeout(function () {
      data =  list1;
      var str ="";
      for(var i in data){
        str +='<li>'+data[i].real_name+'<span>'+data[i].isOn+'</span></li>';
      };

      $('#test').append(str)
  },2000);
  $('#test').on('click','li',function () {
      var index =$(this).index();
      console.log(index)
        for(var i in data){
            $('li').eq(i).find('span').html(0)
        }
    $('li').eq(index).find('span').html(1)
  })

</script>
</body>
</html>
